<template>
  <div id="rootNode">
    <el-card id="overview" shadow="never">
      <div id="patientList">
        <div v-show="toggleShow" id="tagSwitchoverBtn">
          <el-radio-group v-model="tagSwitchover" @change="tagChange()">
            <el-radio-button
              v-if="!($store.getters.hospitalId == 76 || $store.getters.hospitalId == 201)"
              label="胸痛"
              style="height: 45px; line-height: 25px; width: 90px"
            />
            <el-radio-button label="卒中" style="height: 45px; line-height: 25px; width: 90px" />
            <el-radio-button v-if="isTruma" label="创伤" style="height: 45px; line-height: 25px; width: 90px" />
          </el-radio-group>
        </div>
        <div style="width: 100%">
          <div id="todayTotal" class="fl" style="width: 48%">
            <div class="totalTop">
              <div class="quantityTotal" style="width: 60%">
                <div>
                  <span class="fontLv01 content_num" @click="todayQuery(null, null)">
                    {{ summaryCount.totalCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">今日总数量</div>
              </div>
              <div v-show="tagSwitchover != '创伤'" class="quantityTotal">
                <div>
                  <span class="fontLv02 content_num" @click="todayQuery('1', null)">
                    {{ summaryCount.sendCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">已上报数量</div>
              </div>
              <div v-show="tagSwitchover != '创伤'" class="quantityTotal">
                <div>
                  <span class="fontLv02 content_num" @click="todayQuery('0', null)">
                    {{ summaryCount.unSendCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">未上报数量</div>
              </div>
              <div class=" ">
                <span class="iconTotal iconfont icon-jinrishuliang" />
              </div>
              <!-- .icon-zongshuliang -->
            </div>
            <div class="totalbtm pt-5">
              <el-row v-show="tagSwitchover == '胸痛'" :gutter="5">
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'siemidia')">{{ summaryCount.stemiCount
                  }}</span>(人)
                  <div>STEMI</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'nstemidia')">{{ summaryCount.nstemiCount
                  }}</span>(人)
                  <div>NSTEMI</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'uadia')">{{ summaryCount.uaCount
                  }}</span>(人)
                  <div>UA</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'aorticdissection')">{{
                    summaryCount.zdmjcCount }}</span>(人)
                  <div>主动脉夹层</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'pulmonary')">{{ summaryCount.fdmssCount
                  }}</span>(人)
                  <div>肺动脉栓塞</div>
                </el-col>
                <el-col :span="5" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'Non-ACS_cardiogenic_chest_pain')">{{
                    summaryCount.naceCount }}</span>(人)
                  <div>非ACS心源性胸痛</div>
                </el-col>
                <el-col :span="4" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'othercardiogeni')">{{
                    summaryCount.nxyxxtCount }}</span>(人)
                  <div>其他非心源性胸痛</div>
                </el-col>
              </el-row>
              <el-row v-show="tagSwitchover == '卒中'" :gutter="5">
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'hematencephalon')">{{ summaryCount.hp
                  }}</span>(人)
                  <div>脑出血</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'cerebralInfarction')">{{ summaryCount.ci
                  }}</span>(人)
                  <div>脑梗死</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'isuia')">{{ summaryCount.isuia }}</span>(人)
                  <div>颅内动脉瘤</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'cas')">{{ summaryCount.cas }}</span>(人)
                  <div>CEA/CAS</div>
                </el-col>
                <!-- <el-col :span="5" class="fontLv12" @click="todayQuery(null,'siemidia')">
                  <span class="fontLv02 content_num">{{ summaryCount.ci }}</span>(人)
                  <div>静脉溶栓</div>
                </el-col> -->
                <!-- <el-col :span="5" class="fontLv12" @click="todayQuery(null,'siemidia')">
                  <span class="fontLv02 content_num">{{ summaryCount.it }}</span>(人)
                  <div>血管内介入治疗</div>
                </el-col> -->
              </el-row>
              <el-row v-show="tagSwitchover == '创伤'" :gutter="5">
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds1')">{{ summaryCount.mpds1 }}</span>(人)
                  <div>交通/运输事故</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds2')">{{ summaryCount.mpds2 }}</span>(人)
                  <div>高处坠落</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds3')">{{ summaryCount.mpds3 }}</span>(人)
                  <div>暴力袭击/侵犯</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds4')">{{ summaryCount.mpds4 }}</span>(人)
                  <div>动物咬伤/攻击</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds5')">{{ summaryCount.mpds5 }}</span>(人)
                  <div>烧伤(烫伤)/爆炸伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds6')">{{ summaryCount.mpds6 }}</span>(人)
                  <div>锐器刺伤/枪伤/贯穿伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds7')">{{ summaryCount.mpds7 }}</span>(人)
                  <div>触电/雷击伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds8')">{{ summaryCount.mpds8 }}</span>(人)
                  <div>冬季运动损伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds9')">{{ summaryCount.mpds9 }}</span>(人)
                  <div>机械运动损伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds10')">{{ summaryCount.mpds10
                  }}</span>(人)
                  <div>其他</div>
                </el-col>
              </el-row>
            </div>
          </div>

          <div style="width: 4%" class="fl">
            <div class="totalLine" />
          </div>

          <div id="allTotal" class="fl" style="width: 48%">
            <div class="totalTop">
              <div class="quantityTotal" style="width: 60%">
                <div>
                  <span class="fontLv01 content_num" @click="allQuery(null, null)">
                    {{ summaryCountAll.totalCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">总数量</div>
              </div>
              <div v-show="tagSwitchover != '创伤'" class="quantityTotal">
                <div>
                  <span class="fontLv02 content_num" @click="allQuery('1', null)">{{ summaryCountAll.sendCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">已上报数量</div>
              </div>
              <div v-show="tagSwitchover != '创伤'" class="quantityTotal">
                <div>
                  <span class="fontLv02 content_num" @click="allQuery('0', null)">{{ summaryCountAll.unSendCount }}
                  </span>
                  <span class="fontLv12"> (人)</span>
                </div>
                <div class="fontLv12 pt-5 pb-5">未上报数量</div>
              </div>
              <div class=" ">
                <span class="iconTotal iconfont icon-zongshuliang" />
              </div>
            </div>
            <div class="totalbtm pt-5">
              <el-row v-show="tagSwitchover == '胸痛'" :gutter="5">
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'siemidia')">{{ summaryCountAll.stemiCount
                  }}</span>(人)
                  <div>STEMI</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'nstemidia')">{{ summaryCountAll.nstemiCount
                  }}</span>(人)
                  <div>NSTEMI</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'uadia')">{{ summaryCountAll.uaCount
                  }}</span>(人)
                  <div>UA</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'aorticdissection')">{{
                    summaryCountAll.zdmjcCount }}</span>(人)
                  <div>主动脉夹层</div>
                </el-col>
                <el-col :span="3" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'pulmonary')">{{ summaryCountAll.fdmssCount
                  }}</span>(人)
                  <div>肺动脉栓塞</div>
                </el-col>
                <el-col :span="5" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'Non-ACS_cardiogenic_chest_pain')">{{
                    summaryCountAll.naceCount }}</span>(人)
                  <div>非ACS心源性胸痛</div>
                </el-col>
                <el-col :span="4" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'othercardiogeni')">{{
                    summaryCountAll.nxyxxtCount }}</span>(人)
                  <div>其他非心源性胸痛</div>
                </el-col>
              </el-row>
              <el-row v-show="tagSwitchover == '卒中'" :gutter="5">
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'hematencephalon')">{{ summaryCountAll.hp
                  }}</span>(人)
                  <div>脑出血</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'cerebralInfarction')">{{ summaryCountAll.ci
                  }}</span>(人)
                  <div>脑梗死</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'isuia')">{{ summaryCountAll.isuia
                  }}</span>(人)
                  <div>颅内动脉瘤</div>
                </el-col>
                <el-col :span="6" class="fontLv12">
                  <span class="fontLv02 content_num" @click="allQuery(null, 'cas')">{{ summaryCountAll.cas }}</span>(人)
                  <div>CEA/CAS</div>
                </el-col>
                <!-- <el-col :span="5" class="fontLv12" @click="allQuery(null,'siemidia')">
                  <span class="fontLv02 content_num">{{ summaryCountAll.ci }}</span>(人)
                  <div>静脉溶栓</div>
                </el-col> -->
                <!-- <el-col :span="5" class="fontLv12" @click="allQuery(null,'siemidia')">
                  <span class="fontLv02 content_num">{{ summaryCountAll.it }}</span>(人)
                  <div>血管内介入治疗</div>
                </el-col> -->
              </el-row>
              <el-row v-show="tagSwitchover == '创伤'" :gutter="5">
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds1')">{{ summaryCountAll.mpds1
                  }}</span>(人)
                  <div>交通/运输事故</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds2')">{{ summaryCountAll.mpds2
                  }}</span>(人)
                  <div>高处坠落</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds3')">{{ summaryCountAll.mpds3
                  }}</span>(人)
                  <div>暴力袭击/侵犯</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds4')">{{ summaryCountAll.mpds4
                  }}</span>(人)
                  <div>动物咬伤/攻击</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds5')">{{ summaryCountAll.mpds5
                  }}</span>(人)
                  <div>烧伤(烫伤)/爆炸伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds6')">{{ summaryCountAll.mpds6
                  }}</span>(人)
                  <div>锐器刺伤/枪伤/贯穿伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds7')">{{ summaryCountAll.mpds7
                  }}</span>(人)
                  <div>触电/雷击伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds8')">{{ summaryCountAll.mpds8
                  }}</span>(人)
                  <div>冬季运动损伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds9')">{{ summaryCountAll.mpds9
                  }}</span>(人)
                  <div>机械运动损伤</div>
                </el-col>
                <el-col :span="2" class="fontLv12">
                  <span class="fontLv02 content_num" @click="todayQuery(null, 'mpds10')">{{ summaryCountAll.mpds10
                  }}</span>(人)
                  <div>其他</div>
                </el-col>
              </el-row>
            </div>
          </div>
        </div>
      </div>
    </el-card>
    <el-card id="queryForm" shadow="never">
      <div id="queryCriteria">
        <el-form ref="queryForm" :inline="true" :model="queryParam" class="demo-form-inline">
          <el-form-item label="姓名" class="marginR20" prop="patientName"><el-input
            v-model="queryParam.patientName"
            placeholder="姓名"
            clearable
            @keyup.enter.native="queryList"
          /></el-form-item>
          <el-form-item label="患者编号" class="marginR20" prop="dispatchId"><el-input
            v-model="queryParam.dispatchId"
            placeholder="患者编号"
            clearable
            @input="queryParam.dispatchId = queryParam.dispatchId.replace(/[^\d]/g, '')"
            @keyup.enter.native="queryList"
          /></el-form-item>
          <el-form-item label="时间排序" prop="order">
            <el-select v-model="queryParam.order">
              <el-option label="建档时间倒序" value="0" />
              <el-option label="发病时间倒序" value="1" />
              <el-option label="接诊时间倒序" value="2" />
              <!-- <el-option label="出院时间倒序" value="3" /> -->
              <el-option label="建档时间正序" value="10" />
              <el-option label="发病时间正序" value="11" />
              <el-option label="接诊时间正序" value="12" />
              <!-- <el-option label="出院时间正序" value="13" /> -->
            </el-select>
          </el-form-item>
          <el-form-item v-if="tagSwitchover == '卒中'" label="治疗方式" prop="treatment">
            <el-select v-model="queryParam.treatment">
              <el-option label="介入" value="jieru" />
              <el-option label="静脉溶栓" value="rongshuan" />
              <el-option label="脑出血手术" value="naocx" />
              <el-option label="动脉瘤手术" value="dml" />
              <el-option label="CEA/CAS手术" value="ceacas" />
            </el-select>
          </el-form-item>
          <el-form-item label="时间范围" class="marginR20" prop="timeRange">
            <el-date-picker
              v-model="queryParam.timeRange"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd HH:mm:ss"
              clearable
            />
          </el-form-item>
          <el-form-item v-show="tagSwitchover == '胸痛'" label="来院方式" class="marginR20" prop="comeway">
            <el-select v-model="queryParam.comeway" placeholder="请选择" clearable>
              <el-option label="全部" value="" />
              <el-option label="120呼叫" value="1" />
              <el-option label="转院" value="2" />
              <el-option label="自行来院" value="3" />
              <el-option label="院内发病" value="4" />
            </el-select>
          </el-form-item>

          <el-form-item v-show="tagSwitchover == '卒中'" label="来院方式" class="marginR20" prop="comeway">
            <el-select v-model="queryParam.comeway" placeholder="请选择" clearable>
              <el-option label="全部" value="" />
              <el-option label="本院急救车" value="6" />
              <el-option label="当地120" value="7" />
              <el-option label="外院转院来院" value="8" />
              <el-option label="自行来院" value="9" />
              <el-option label="在院卒中" value="10" />
            </el-select>
          </el-form-item>
          <el-form-item v-show="tagSwitchover == '创伤'" label="来院方式" class="marginR20" prop="comeway">
            <el-select v-model="queryParam.comeway" placeholder="请选择" clearable>
              <el-option label="全部" value="" />
              <el-option label="呼叫出车" value="1" />
              <el-option label="外院转院" value="2" />
              <el-option label="自行来院" value="3" />
              <el-option label="院内发病" value="4" />
            </el-select>
          </el-form-item>

          <el-form-item class="floatR">
            <!-- <el-button>高级查询</el-button> -->
            <el-button @click="activeNames = !activeNames">高级查询</el-button>
            <el-button type="primary" @click="clearPagination(); queryList()">搜索</el-button>
            <el-button @click="queryClear()">重置</el-button>
          </el-form-item>
          <el-collapse-transition>
            <div v-show="activeNames" class="advancedQuery">
              <!-- 胸痛 -->
              <el-form-item v-show="tagSwitchover == '胸痛'" label="初步诊断" class="marginR20" prop="diagnose">
                <el-select v-model="queryParam.diagnose" placeholder="请选择" clearable>
                  <el-option label="全部" value="" />
                  <el-option label="STEMI" value="siemidia" />
                  <el-option label="NSTEMI" value="nstemidia" />
                  <el-option label="UA" value="uadia" />
                  <el-option label="主动脉夹层" value="aorticdissection" />
                  <el-option label="肺动脉栓塞" value="pulmonary" />
                  <el-option label="非ACS心源性胸痛" value="Non-ACS_cardiogenic_chest_pain" />
                  <el-option label="其他非心源性胸痛" value="othercardiogeni" />
                  <el-option label="胸痛待查" value="othercardiogeni" />
                  <el-option label="胸闷待查" value="othercardiogeni" />
                  <el-option label="未明确诊断" value="othercardiogeni" />
                </el-select>
              </el-form-item>
              <!-- 卒中 -->
              <el-form-item v-show="tagSwitchover == '卒中'" label="确诊诊断" class="marginR20" prop="diagnose">
                <el-select v-model="queryParam.diagnose" placeholder="请选择" clearable>
                  <el-option label="全部" value="" />
                  <el-option label="脑梗死" value="cerebralInfarction" />
                  <el-option label="脑出血" value="hematencephalon" />
                  <!-- <el-option label="自发性蛛网膜下腔出血" value="sah" /> -->
                  <!-- <el-option label="TIA" value="tia" /> -->
                  <el-option label="颅内动脉瘤" value="isuia" />
                  <el-option label="颈动脉狭窄或闭塞" value="cas" />
                  <!-- <el-option label="动静脉畸形" value="avmAVM" /> -->
                  <!-- <el-option label="烟雾病" value="mmd" /> -->
                  <el-option label="病因未明放弃治疗" value="giveUp" />
                </el-select>
              </el-form-item>

              <el-form-item label="性别" class="marginR20" prop="sex">
                <el-select v-model="queryParam.sex" placeholder="请选择" clearable>
                  <el-option label="全部" value="" />
                  <el-option label="男" value="男" />
                  <el-option label="女" value="女" />
                </el-select>
              </el-form-item>
              <el-form-item label="年龄段" class="ageWidth" label-width="60px">
                <el-form-item prop="agestart" class="fl" style="width: 40%">
                  <el-input
                    v-model="queryParam.agestart"
                    placeholder=""
                    clearable
                    @input=" queryParam.agestart = queryParam.agestart.replace(/[^\d]/g, '')"
                  >
                    <template slot="append">岁</template>
                  </el-input>
                </el-form-item>
                <el-form-item class="fl"> 至 </el-form-item>
                <el-form-item prop="ageend" class="fl" style="width: 40%">
                  <el-input
                    v-model="queryParam.ageend"
                    placeholder=""
                    clearable
                    @input=" queryParam.ageend = queryParam.ageend.replace(/[^\d]/g, '')"
                  >
                    <template slot="append">岁</template>
                  </el-input>
                </el-form-item>
              </el-form-item>
              <el-form-item
                v-if="tagSwitchover == '胸痛' && hospitalId != 68"
                label="建档上报"
                class="marginR20"
                prop="cpcstat"
              >
                <el-select v-model="queryParam.cpcstat" placeholder="请选择" clearable>
                  <el-option label="未上报" value="0" />
                  <el-option label="已上报" value="1" />
                </el-select>
              </el-form-item>

              <el-form-item v-if="tagSwitchover != '创伤'" label="最终上报" class="marginR20" prop="yzystat">
                <el-select v-model="queryParam.yzystat" placeholder="请选择" clearable>
                  <el-option label="初始填写" value="0" />
                  <el-option label="退回重填" value="1" />
                  <el-option label="提交审核中" value="2" />
                  <el-option label="初审通过" value="3" />
                  <el-option label="上报重填" value="4" />
                  <el-option label="上报列队中" value="5" />
                </el-select>
              </el-form-item>

              <el-form-item label="建档科室" prop="dept">
                <el-select v-model="queryParam.dept" placeholder="请选择" clearable>
                  <el-option v-for="(item, index) in deptList" :key="index" :label="item.name" :value="item.name" />
                </el-select>
              </el-form-item>

              <!-- td-start -->
              <el-form-item v-show="tagSwitchover == '创伤'" label="MPDS" class="marginR20" prop="mpds">
                <el-select v-model="queryParam.mpds" placeholder="请选择" clearable>
                  <el-option label="交通/运输事故" value="0" />
                  <el-option label="高处坠落" value="1" />
                  <el-option label="暴力袭击/侵犯" value="2" />
                  <el-option label="动物咬伤/攻击" value="3" />
                  <el-option label="烧伤(烫伤)/爆炸伤" value="4" />
                  <el-option label="锐器刺伤/枪伤/贯穿伤" value="5" />
                  <el-option label="触电/雷击伤" value="6" />
                  <el-option label="冬季运动损伤" value="7" />
                  <el-option label="机械损伤" value="8" />
                  <el-option label="创伤(其他创伤)" value="9" />
                </el-select>
              </el-form-item>
              <el-form-item v-show="tagSwitchover == '创伤'" label="病情判断" class="marginR20" prop="cas">
                <el-select v-model="queryParam.cas" placeholder="请选择" clearable>
                  <el-option label="非急" value="0" />
                  <el-option label="亚急" value="1" />
                  <el-option label="急症" value="2" />
                  <el-option label="严重" value="3" />
                  <el-option label="濒危" value="4" />
                  <el-option label="死亡" value="5" />
                </el-select>
              </el-form-item>
              <el-form-item v-show="tagSwitchover == '创伤'" label="数据填报员" label-width="82px">
                <el-form-item style="width: 50%">
                  <el-input v-model="queryParam.filldoc" placeholder="" clearable />
                </el-form-item>
              </el-form-item>
              <!-- td-end -->
            </div>
          </el-collapse-transition>
          <!-- <el-form-item label="治疗措施" class="marginR20">
            <el-select v-model="queryParam.diagnose" placeholder="请选择">
              <el-option label="全部" value="" />
              <el-option label="介入治疗" value="介入治疗" />
              <el-option label="溶栓治疗" value="溶栓治疗" />
              <el-option label="保守治疗" value="保守治疗" />
              <el-option label="放弃治疗" value="放弃治疗" />
            </el-select>
          </el-form-item> -->
        </el-form>
      </div>
      <div id="queryTable" style="clear: both">
        <el-tabs v-model="tabCheck" type="border-card" @tab-click="handleClick">
          <el-tab-pane label="全部" name="all" />
          <el-tab-pane label="急救中" name="firstAid" />
          <el-tab-pane label="会诊中" name="consultation" />
          <el-tab-pane label="已转归" name="outcome" />
          <el-tab-pane v-if="VUE_APP_BASE_API_DATA_BRANCH == 'https://zmdszxyy.cdhyhs.com:20050' && tagSwitchover == '胸痛'" label="已转归未审核" name="outUnaudited" />
          <el-tab-pane v-if="tagSwitchover == '胸痛' && hospitalId == 68" label="未上报" name="notrep" />
          <el-tab-pane v-if="tagSwitchover == '胸痛' && hospitalId == 68" label="已上报" name="hasrep" />
          <el-tab-pane label="关注" name="att" />
          <el-tab-pane label="归档" name="oce" />
          <el-tab-pane v-if="VUE_APP_BASE_API_DATA_BRANCH == 'https://gzysdyy.cdhyhs.com:20000' && tagSwitchover == '卒中'" label="已下载" name="downloaded" />
          <div id="tableData" style="">
            <el-table id="out-table" :data="tableData" style="width: 100%" border>
              <!-- <el-table-column type="selection" width="55" align="center" /> -->
              <el-table-column type="index" width="60" align="center">
                <template slot-scope="scope" align="center">
                  {{ (page - 1) * limit + scope.$index + 1 }}
                </template>
              </el-table-column>
              <!-- <el-table-column prop="dispatchId" label="任务号" align="center" /> -->
              <!-- <el-table-column prop="medicalId" label="病案号" align="center" /> -->
              <el-table-column
                v-if="filterTableHeader('buildTime')"
                prop="buildTime"
                label="建档时间"
                align="center"
                sortable
                :sort-method="(sort1, sort2) => sortTableHeadle(sort1, sort2, 'buildTime')
                "
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.buildTime">
                    <div>{{ scope.row.buildTime.split(' ')[0] }}</div>
                    <div>{{ scope.row.buildTime.split(' ')[1] }}</div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('incidentDateTime')"
                prop="incidentDateTime"
                label="发病时间"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>
                  sortTableHeadle(sort1, sort2, 'incidentDateTime')
                "
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.incidentDateTime">
                    <div>{{ scope.row.incidentDateTime.split(' ')[0] }}</div>
                    <div>{{ scope.row.incidentDateTime.split(' ')[1] }}</div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('inhospitalAdmissionTime')"
                prop="inhospitalAdmissionTime"
                label="接诊时间"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>
                  sortTableHeadle(sort1, sort2, 'inhospitalAdmissionTime')
                "
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.inhospitalAdmissionTime">
                    <div>
                      {{ scope.row.inhospitalAdmissionTime.split(' ')[0] }}
                    </div>
                    <div>
                      {{ scope.row.inhospitalAdmissionTime.split(' ')[1] }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('dispatchId')"
                prop="dispatchId"
                label="患者编号"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'dispatchId')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.dispatchId">
                    <div>
                      {{ scope.row.dispatchId }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column v-if="filterTableHeader('patientName')" prop="patientName" label="患者姓名" align="center">
                <template slot-scope="scope">
                  <el-tooltip
                    v-if="scope.row.operationLog && scope.row.operationLog.length > 0"
                    class="item"
                    effect="dark"
                    placement="bottom"
                  >
                    <div slot="content">
                      <div v-for="(item, index) in scope.row.operationLog" :key="index">
                        {{ item.created_at }}由{{ item.department }}{{ item.username }}{{ item.operationName }}
                      </div>
                    </div>
                    <span>{{ scope.row.patientName }}</span>
                  </el-tooltip>
                  <span v-else>{{ scope.row.patientName }}</span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('sex')"
                prop="sex"
                label="患者性别"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'sex')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.sex">
                    <div>
                      {{ scope.row.sex }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('patientAge')"
                prop="patientAge"
                label="患者年龄"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'patientAge')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.patientAge">
                    <div>
                      {{ scope.row.patientAge }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('contactPhone')"
                prop="contactPhone"
                label="患者电话"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'contactPhone')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.contactPhone">
                    <div>
                      {{ scope.row.contactPhone }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('comeway')"
                prop="comeway"
                label="来院方式"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'comeway')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.comeway">
                    <div>
                      {{ scope.row.comeway }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <!-- td-start -->
              <el-table-column
                v-if="filterTableHeader('mpds')"
                prop="mpds"
                label="MPDS"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'mpds')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.mpds">
                    <div>
                      {{ scope.row.mpds }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <!-- td-end -->
              <el-table-column
                v-if="filterTableHeader('diagnoseContent')"
                prop="diagnoseContent"
                label="诊断"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'diagnoseContent')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.diagnoseContent">
                    <div>
                      {{ scope.row.diagnoseContent }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('treatment')"
                :key="Math.random()"
                prop="treatment"
                label="治疗方式"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'treatment')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.treatment">
                    <div>
                      {{ scope.row.treatment }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('inspectionTtype')"
                prop="inspectionTtype"
                label="影像检查"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'inspectionTtype')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.inspectionTtype">
                    <div>
                      {{ scope.row.inspectionTtype }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('departmentName')"
                prop="departmentName"
                label="当前科室"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'departmentName')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.departmentName">
                    <div>
                      {{ scope.row.departmentName }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('deptstat')"
                prop="deptstat"
                label="科室状态"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'deptstat')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.deptstat">
                    <div>
                      {{ scope.row.deptstat }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('nextdept')"
                prop="nextdept"
                label="下一级科室"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'nextdept')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.nextdept">
                    <div>
                      {{ scope.row.nextdept }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('nextdeptstat')"
                prop="nextdeptstat"
                label="下一级科室状态"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'nextdeptstat')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.nextdeptstat">
                    <div>
                      {{ scope.row.nextdeptstat }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <!-- td-start -->
              <el-table-column
                v-if="filterTableHeader('leaveTime')"
                prop="leaveTime"
                label="出院时间"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'leaveTime')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.leaveTime">
                    <div>
                      {{ scope.row.leaveTime }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <!-- td-end -->
              <el-table-column
                v-if="filterTableHeader('outstat')"
                prop="outstat"
                label="转归状态"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'outstat')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.outstat">
                    <div>
                      {{ scope.row.outstat }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('doctorName')"
                prop="doctorName"
                label="医生姓名"
                align="center"
                sortable
                :sort-method="(sort1, sort2) =>sortTableHeadle(sort1, sort2, 'doctorName')"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.doctorName">
                    <div>
                      {{ scope.row.doctorName }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <!-- // yzystat
              // 0:初始填写
              // 1：退回重填
              // 2：提交审核中
              // 3：初审通过
              // 4：上报重填
              // 5：上报审核中
              // 6：已上报

              // cpcstat
              // 0:未建档上报
              // 1:已建档上报
              // 2:已上报 -->

              <el-table-column v-if="filterTableHeader('isUpload')" prop="isUpload" label="最终上报" align="center">
                <template slot-scope="scope">
                  <div v-if="scope.row.isUpload == 0" class="status span_blue">未上报</div>
                  <div v-if="scope.row.isUpload != 0 && scope.row.isUpload" class="status span_green">已上报</div>
                </template>
              </el-table-column>

              <el-table-column v-if="filterTableHeader('cpcstat')" prop="cpcstat" label="建档上报" align="center">
                <template slot-scope="scope">
                  <div v-if="scope.row.cpcstat == 0" class="status span_blue">未上报</div>
                  <div v-if="scope.row.cpcstat != 0 && scope.row.cpcstat" class="status span_green">已上报</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('yzystat') && tagSwitchover == '卒中'"
                prop="yzystat"
                label="最终上报"
                align="center"
              >
                <template slot-scope="scope">
                  <div
                    v-if="scope.row.yzystat < 6"
                    class="status span_blue"
                    :style="{ color: scope.row.yzystat != 0 ? '#fff' : '#4EA1FF', backgroundColor: scope.row.yzystat == 1 ? '#3BFF5F' : scope.row.yzystat == 2 ? '#3BFFF8' : scope.row.yzystat == 3 ? '#3BADFF' : scope.row.yzystat == 4 ? '#3BA0FF' : scope.row.yzystat == 5 ? '#7640C6' : '' }"
                  >
                    {{ scope.row.yzystat === 0 ? '初始填写' : scope.row.yzystat === 1 ? '退回重填' : scope.row.yzystat ===
                      2 ? '提交审核中' : scope.row.yzystat === 3 ? '初审通过' : scope.row.yzystat === 4 ? '上报重填' : scope.row.yzystat ===
                        5 ? '上报列队中' : '' }}
                  </div>
                  <div v-if="scope.row.yzystat == 6 && scope.row.cpcstat" class="status span_green">已下载</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('yzystat') && tagSwitchover == '胸痛'"
                prop="yzystat"
                label="最终上报"
                align="center"
              >
                <template slot-scope="scope">
                  <div
                    v-if="scope.row.yzystat < 6"
                    class="status span_blue"
                    :style="{
                      color: scope.row.diagnoseContent ? (scope.row.isGiveUp == 1 || scope.row.diagnoseContent.split(',').includes('非ACS心源性胸痛') || scope.row.diagnoseContent.split(',').includes('其他非心源性胸痛') || scope.row.diagnoseContent.split(',').includes('待查') || scope.row.diagnoseContent.split(',').includes('胸闷待查') || scope.row.diagnoseContent.split(',').includes('胸痛待查') || scope.row.diagnoseContent.split(',').includes('未明确诊断')) ? '#fff' : scope.row.yzystat ? scope.row.yzystat == 0 ? '#4EA1FF' : '#fff' : '' : '',
                      backgroundColor: scope.row.diagnoseContent ? (scope.row.isGiveUp == 1 || scope.row.diagnoseContent.split(',').includes('非ACS心源性胸痛') || scope.row.diagnoseContent.split(',').includes('其他非心源性胸痛') || scope.row.diagnoseContent.split(',').includes('待查') || scope.row.diagnoseContent.split(',').includes('胸闷待查') || scope.row.diagnoseContent.split(',').includes('胸痛待查') || scope.row.diagnoseContent.split(',').includes('未明确诊断')) ? '#999' : scope.row.yzystat == 1 ? '#3BFF5F' : scope.row.yzystat == 2 ? '#3BFFF8' : scope.row.yzystat == 3 ? '#3BADFF' : scope.row.yzystat == 4 ? '#3BA0FF' : scope.row.yzystat == 5 ? '#7640C6' : '' : ''
                    }"
                  >
                    {{ scope.row.diagnoseContent ? (scope.row.isGiveUp == 1 ||
                      scope.row.diagnoseContent.split(',').includes('非ACS心源性胸痛') ||
                      scope.row.diagnoseContent.split(',').includes('其他非心源性胸痛') ||
                      scope.row.diagnoseContent.split(',').includes('待查') ||
                      scope.row.diagnoseContent.split(',').includes('胸闷待查') ||
                      scope.row.diagnoseContent.split(',').includes('胸痛待查') ||
                      scope.row.diagnoseContent.split(',').includes('未明确诊断')) ? '无' : scope.row.yzystat == 0 ?
                      '初始填写' : scope.row.yzystat == 1 ? '退回重填' : scope.row.yzystat == 2 ? '提交审核中' : scope.row.yzystat ==
                        3 ? '初审通过' : scope.row.yzystat == 4 ? '上报重填' : scope.row.yzystat == 5 ? '上报审核中' : '无' : '无' }}
                  </div>
                  <div v-if="scope.row.yzystat == 6 && scope.row.cpcstat" class="status span_green">已上报</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('cw_120_first_doctor_name')"
                :key="Math.random()"
                prop="cw_120_first_doctor_name"
                label="急诊医护人员"
                align="center"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.cw_120_first_doctor_name">
                    <div>
                      {{ scope.row.cw_120_first_doctor_name }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('decisionDoctor')"
                :key="Math.random()"
                prop="decisionDoctor"
                label="决定介入医生"
                align="center"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.decisionDoctor">
                    <div>
                      {{ scope.row.decisionDoctor }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('interveneDoctor')"
                :key="Math.random()"
                prop="interveneDoctor"
                label="介入医师"
                align="center"
              >
                <template slot-scope="scope" align="center">
                  <span v-if="scope.row.interveneDoctor">
                    <div>
                      {{ scope.row.interveneDoctor }}
                    </div>
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="filterTableHeader('performanceName')"
                prop="performanceName"
                label="绩效统计"
                align="center"
              />
              <el-table-column fixed="right" label="操作" width="180" align="center">
                <template slot-scope="scope">
                  <el-button size="mini" class="mr-10" type="text" @click="checkRecords(scope.row)">查看</el-button>
                  <span v-show="!consultationCheck">
                    <el-button
                      v-if="scope.row.attStatus != '1'"
                      size="mini"
                      class="mr-10"
                      type="text"
                      @click="attentionStatus(scope.row)"
                    >关注</el-button>
                    <el-button
                      v-else
                      size="mini"
                      class="mr-10"
                      style="color: #ff4949"
                      type="text"
                      @click="attentionStatus(scope.row)"
                    >取消关注</el-button>
                  </span>
                  <el-button size="mini" type="text" @click="deletRecords(scope.row)">删除</el-button>
                  <el-button
                    v-if="VUE_APP_BASE_API_DATA_BRANCH == 'https://gzysdyy.cdhyhs.com:20000' && tagSwitchover == '卒中'"
                    size="mini"
                    type="text"
                    :style="{color: ((scope.row.isUploadStrokeMap == 0 || !scope.row.isUploadStrokeMap) && (scope.row.isVerifyStrokeMap == 0 || !scope.row.isVerifyStrokeMap)) ? '#13C2C2' : (scope.row.isVerifyStrokeMap == 1 && (scope.row.isUploadStrokeMap == 0 || !scope.row.isUploadStrokeMap)) ? 'orange' : (scope.row.isUploadStrokeMap == 1 && scope.row.isVerifyStrokeMap == 1) ? '#999' : ''}"
                    @click="syncMap(scope.row)"
                  >{{ ((scope.row.isUploadStrokeMap == 0 || !scope.row.isUploadStrokeMap) && (scope.row.isVerifyStrokeMap == 0 || !scope.row.isVerifyStrokeMap)) ? '同步至卒中地图' : (scope.row.isVerifyStrokeMap == 1 && (scope.row.isUploadStrokeMap == 0 || !scope.row.isUploadStrokeMap)) ? '待上传至卒中地图' : (scope.row.isUploadStrokeMap == 1 && scope.row.isVerifyStrokeMap == 1) ? '已同步至卒中地图' : '' }}</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-pagination
              class="pagination"
              :current-page.sync="page"
              :page-sizes="[10, 20, 30, 40, 50, 60, 70, 80, 90]"
              :page-size.sync="limit"
              layout="sizes, prev, pager, next ,total"
              :total="count"
              background
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
            />
          </div>
        </el-tabs>
        <div class="tableBtnGroup">
          <el-button v-if="tagSwitchover === '卒中'" type="primary" size="mini" @click="strokeInfoAdd">
            患者新增
          </el-button>
          <el-popover v-if="tagSwitchover === '胸痛'" placement="left-start" width="150" trigger="click">
            <el-checkbox-group v-model="tableHeadersFilter" :min="1" @change="tableFilter(tableHeadersFilter,'胸痛')">
              <el-checkbox v-for="(item, index) in tableHeaders" :key="index" :label="index">{{ item }}</el-checkbox>
            </el-checkbox-group>
            <el-button slot="reference" size="mini">筛选列</el-button>
          </el-popover>
          <el-popover v-if="tagSwitchover === '卒中'" placement="left-start" width="150" trigger="click">
            <el-checkbox-group v-model="tableHeadersStrokeFilter" :min="1" @change="tableFilter(tableHeadersStrokeFilter,'卒中')">
              <el-checkbox v-for="(item, index) in tableHeadersStroke" :key="index" :label="index">{{ item }}</el-checkbox>
            </el-checkbox-group>
            <el-button slot="reference" size="mini">筛选列</el-button>
          </el-popover>
          <el-popover v-if="tagSwitchover === '创伤'" placement="left-start" width="150" trigger="click">
            <el-checkbox-group v-model="tableHeadersTraumaFilter" :min="1" @change="tableFilter(tableHeadersTraumaFilter,'创伤')">
              <el-checkbox v-for="(item, index) in tableHeadersTrauma" :key="index" :label="index">{{ item }}</el-checkbox>
            </el-checkbox-group>
            <el-button slot="reference" size="mini">筛选列</el-button>
          </el-popover>
          <el-button plain size="mini" @click="exportExcel()">
            导出当前页
          </el-button>
          <!-- <el-button plain size="mini" @click="handleClick">
            <svg-icon class-name="funcIcon" icon-class="print" />
            打印
          </el-button> -->
          <!-- <el-button plain size="mini" @click="handleClick">
            <svg-icon class-name="funcIcon" icon-class="print" />
            打印
          </el-button> -->
        </div>
      </div>
    </el-card>
    <el-dialog
      title="绿道数据信息总表"
      :visible.sync="mapVisible"
      center
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      width="800px"
    >
      <div id="map-box" class="map-box">
        <div id="box-left" class="box-left">
          <div data-id="info" class="left-line cls" @click="skipView('info')">基本信息表</div>
          <div data-id="preHospital" class="left-line" @click="skipView('preHospital')">院前处理表</div>
          <div data-id="sign" class="left-line" @click="skipView('sign')">体征</div>
          <div data-id="medicalHistory" class="left-line" @click="skipView('medicalHistory')">病史记录表</div>
          <div data-id="laboratory" class="left-line" @click="skipView('laboratory')">实验室检查表</div>
          <div data-id="image" class="left-line" @click="skipView('image')">影像信息</div>
          <div data-id="triage" class="left-line" @click="skipView('triage')">分检诊结果表</div>
          <div data-id="reperfusion" class="left-line" @click="skipView('reperfusion')">再灌注治疗表</div>
          <div data-id="prognosis" class="left-line" @click="skipView('prognosis')">患者转归</div>
          <div data-id="timeNode" class="left-line" @click="skipView('timeNode')">时间节点表</div>
          <div data-id="grade" class="left-line" @click="skipView('grade')">评分表</div>
          <div data-id="attachments" class="left-line" @click="skipView('attachments')">附件表</div>
        </div>
        <div id="box-right" class="box-right">
          <div id="info" class="right-content">
            <div class="right-title">基本信息表</div>
            <div v-for="(item, index) in mapHZData" :key="index">{{ item }}</div>
          </div>
          <div id="preHospital" class="right-content">
            <div class="right-title">院前处理表</div>
            <div v-for="(item, index) in mapPREData" :key="index">{{ item }}</div>
          </div>
          <div id="sign" class="right-content">
            <div class="right-title">体征</div>
            <div v-for="(item, index) in mapTZData" :key="index">{{ item }}</div>
          </div>
          <div id="medicalHistory" class="right-content">
            <div class="right-title">病史记录表</div>
            <div v-for="(item, index) in mapMEDData" :key="index">{{ item }}</div>
          </div>
          <div id="laboratory" class="right-content">
            <div class="right-title">实验室检查表</div>
            <div v-for="(item, index) in mapLABData" :key="index">{{ item }}</div>
          </div>
          <div id="image" class="right-content">
            <div class="right-title">影像信息</div>
            <div v-for="(item, index) in mapIMGData" :key="index">{{ item }}</div>
          </div>
          <div id="triage" class="right-content">
            <div class="right-title">分检诊结果表</div>
            <div v-for="(item, index) in mapTRIData" :key="index">{{ item }}</div>
          </div>
          <div id="reperfusion" class="right-content">
            <div class="right-title">再灌注治疗表</div>
            <div v-for="(item, index) in mapREPData" :key="index">{{ item }}</div>
          </div>
          <div id="prognosis" class="right-content">
            <div class="right-title">患者转归</div>
            <div v-for="(item, index) in mapOUTData" :key="index">{{ item }}</div>
          </div>
          <div id="timeNode" class="right-content">
            <div class="right-title">时间节点表</div>
            <div v-for="(item, index) in mapTIMEData" :key="index">{{ item }}</div>
          </div>
          <div id="grade" class="right-content">
            <div class="right-title">评分表</div>
            <div v-for="(item, index) in mapGRADEData" :key="index">{{ item }}</div>
          </div>
          <div id="attachments" class="right-content">
            <div class="right-title">附件表</div>
            <div v-for="(item, index) in mapATTData" :key="index">{{ item }}</div>
          </div>
        </div>
      </div>
      <div slot="footer">
        <el-button v-if="!(isUploadStrokeMap == 1 && isVerifyStrokeMap == 1)" @click="mapVisible = false">取消</el-button>
        <el-button v-if="!(isUploadStrokeMap == 1 && isVerifyStrokeMap == 1)" type="primary" @click="submitMap">确认并将数据同步到卒中地图</el-button>
        <el-button v-if="(isUploadStrokeMap == 1 && isVerifyStrokeMap == 1)" @click="mapVisible = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>

import { hospitalIdDept } from '@/api/back-management/user-manage/dept'
import { getToken } from '@/utils/auth'
import { getStrokeMapData, uploadSdcStrokeMapData } from '@/api/green-channel/homePage'
import {
  queryListGet,
  queryConsultationListGet,
  dispatcheACSSummaryCounts,
  dispatcheCISSummaryCounts,
  dispatcheACSSummaryCountsToday,
  dispatcheCISSummaryCountsToday,
  dispatcheTraumaSummaryCounts,
  dispatcheTraumaSummaryCountsToday,
  updateAttention,
  deletePatient
} from '@/api/green-channel/patients-list'
import { newDispatch } from '@/api/triage/triage-new'
export default {
  // name: 'GreenChannel',
  data() {
    return {
      mapVisible: false,
      mapId: '',
      isUploadStrokeMap: '',
      isVerifyStrokeMap: '',
      VUE_APP_BASE_API_DATA_BRANCH: '',
      mapHZData: [],
      mapPREData: [],
      mapTZData: [],
      mapMEDData: [],
      mapLABData: [],
      mapIMGData: [],
      mapTRIData: [],
      mapREPData: [],
      mapOUTData: [],
      mapTIMEData: [],
      mapGRADEData: [],
      mapATTData: [],
      isTruma: false,
      isCuZhongMap: false,
      toggleShow: true,
      deptList: [],
      hospitalId: this.$store.getters.hospitalId,
      userId: this.$store.getters.userId,
      apiToken: this.$store.getters.apiToken,
      tabCheck: 'all',
      isOut: '',
      page: 1,
      limit: 10,
      count: 0,
      isOutList: {
        all: '', // 全部
        firstAid: 'aid', // 急救中
        consultation:'consultation',  //会诊中
        outcome: 'out', // 已转归
        outUnaudited: 'outUnaudited', // 已转归未审核
        att: 'att', // 关注
        oce: 'oce', // 归档
        downloaded: 'downloaded', // 已下载
        notrep: 'notrep', // 未上报
        hasrep: 'hasrep' // 已上报
      },
      consultationCheck: false, // 当前是否为会诊tab页 && 两个接口患者姓名显示切换
      queryParam: {
        patientName: '', // 姓名
        dispatchId: '', // 患者编号
        timeRange: [], // 时间范围
        comeway: '', // 来院方式
        order: '',
        dept: '', // 科室
        diagnoseContent: '', // 病情判断
        diagnose: '', // Mpds
        mpds: '', // MPDS
        cas: '', // 病情判断
        filldoc: '', // 数据填报员
        sex: '', // 性别
        agestart: '', // 年龄段(小)
        ageend: '', // 年龄段(大)
        treatment: '', // 治疗方式
        isUpload: '', // 上报状态
        cpcstat: '', // 建档上报
        yzystat: '' // 最终上报
      },
      excelHeaders: {
        buildTime: '建档时间',
        incidentDateTime: '发病时间',
        inhospitalAdmissionTime: '接诊时间',
        dispatchId: '患者编号',
        patientName: '患者姓名',
        sex: '患者性别',
        patientAge: '患者年龄',
        contactPhone: '患者电话',
        comeway: '来院方式',
        mpds: 'MPDS',
        diagnoseContent: '诊断',
        treatment: '治疗方式',
        inspectionTtype: '影像检查',
        departmentName: '当前科室',
        // doctorName: '医生姓名',
        deptstat: '当前科室状态',
        nextdept: '流传下一级科室',
        nextdeptstat: '流传下一级科室状态',
        cpcstat: '建档上报',
        yzystat: '最终上报',
        leaveTime: '出院时间',
        performanceName: '绩效统计',
        cw_120_first_doctor_name: '急诊医护人员',
        decisionDoctor: '决定介入医生',
        interveneDoctor: '介入医师'
      },
      excelHeadersFilter: [
        'buildTime',
        'incidentDateTime',
        'inhospitalAdmissionTime',
        'dispatchId',
        'patientName',
        'sex',
        'patientAge',
        'contactPhone',
        'comeway',
        'mpds',
        'diagnoseContent',
        'treatment',
        'inspectionTtype',
        'departmentName',
        'leaveTime',
        // 'doctorName',
        'deptstat',
        'nextdept',
        'nextdeptstat',
        'cpcstat',
        'yzystat',
        'performanceName',
        'cw_120_first_doctor_name',
        'decisionDoctor',
        'interveneDoctor'
      ],
      tableHeaders: {
        buildTime: '建档时间',
        incidentDateTime: '发病时间',
        inhospitalAdmissionTime: '接诊时间',
        dispatchId: '患者编号',
        patientName: '患者姓名',
        sex: '患者性别',
        patientAge: '患者年龄',
        contactPhone: '患者电话',
        comeway: '来院方式',
        diagnoseContent: '诊断',
        treatment: '治疗方式',
        inspectionTtype: '影像检查',
        departmentName: '当前科室',
        deptstat: '科室状态',
        nextdept: '下一级科室',
        nextdeptstat: '下一级科室状态',
        // doctorName: '医生姓名',
        // outstat: '转归状态',
        // isUpload: '上报状态',
        cpcstat: '建档上报',
        yzystat: '最终上报',
        leaveTime: '出院时间',
        performanceName: '绩效统计',
        cw_120_first_doctor_name: '急诊医护人员',
        decisionDoctor: '决定介入医生',
        interveneDoctor: '介入医师'
      },
      tableHeadersStroke: {
        buildTime: '建档时间',
        incidentDateTime: '发病时间',
        inhospitalAdmissionTime: '接诊时间',
        dispatchId: '患者编号',
        patientName: '患者姓名',
        sex: '患者性别',
        patientAge: '患者年龄',
        contactPhone: '患者电话',
        comeway: '来院方式',
        diagnoseContent: '诊断',
        treatment: '治疗方式',
        inspectionTtype: '影像检查',
        departmentName: '当前科室',
        deptstat: '科室状态',
        nextdept: '下一级科室',
        nextdeptstat: '下一级科室状态',
        cpcstat: '建档上报',
        yzystat: '最终上报',
        leaveTime: '出院时间',
        performanceName: '绩效统计'
      },
      tableHeadersTrauma: {
        buildTime: '建档时间',
        incidentDateTime: '发病时间',
        inhospitalAdmissionTime: '接诊时间',
        dispatchId: '患者编号',
        patientName: '患者姓名',
        sex: '患者性别',
        patientAge: '患者年龄',
        contactPhone: '患者电话',
        comeway: '来院方式',
        mpds: '交通/运输事故',
        diagnoseContent: '诊断',
        treatment: '治疗方式',
        inspectionTtype: '影像检查',
        departmentName: '当前科室',
        deptstat: '科室状态',
        nextdept: '下一级科室',
        nextdeptstat: '下一级科室状态',
        // doctorName: '医生姓名',
        // outstat: '转归状态',
        // isUpload: '上报状态',
        cpcstat: '建档上报',
        yzystat: '最终上报',
        leaveTime: '出院时间',
        performanceName: '绩效统计',
        cw_120_first_doctor_name: '急诊医护人员',
        decisionDoctor: '决定介入医生',
        interveneDoctor: '介入医师'
      },
      tableHeadersFilter: [
        'buildTime',
        'incidentDateTime',
        'inhospitalAdmissionTime',
        'dispatchId',
        'patientName',
        'sex',
        'patientAge',
        'contactPhone',
        'comeway',
        'diagnoseContent',
        'treatment',
        'inspectionTtype',
        'departmentName',
        'deptstat',
        'nextdept',
        'nextdeptstat',
        'cpcstat',
        'yzystat',
        'leaveTime',
        'performanceName',
        'cw_120_first_doctor_name',
        'decisionDoctor',
        'interveneDoctor'
      ],
      tableHeadersStrokeFilter: [
        'buildTime',
        'incidentDateTime',
        'inhospitalAdmissionTime',
        'dispatchId',
        'patientName',
        'sex',
        'patientAge',
        'contactPhone',
        'comeway',
        'diagnoseContent',
        'treatment',
        // 'treatmentMode',
        'inspectionTtype',
        'departmentName',
        'deptstat',
        'nextdept',
        'nextdeptstat',
        'yzystat',
        'leaveTime',
        'performanceName'
      ],
      tableHeadersTraumaFilter: [
        'buildTime',
        'incidentDateTime',
        'inhospitalAdmissionTime',
        'dispatchId',
        'patientName',
        'sex',
        'patientAge',
        'contactPhone',
        'comeway',
        'mpds',
        'diagnoseContent',
        'treatment',
        'inspectionTtype',
        'departmentName',
        'deptstat',
        'nextdept',
        'nextdeptstat',
        'yzystat',
        'leaveTime',
        'performanceName'

      ],
      activeNames: false,
      summaryCount: {},
      summaryCountAll: {},
      tagSwitchover: (this.$store.getters.hospitalId == '76' || this.$store.getters.hospitalId == '201') ? '卒中' : '胸痛',
      tableData: [], // 表格数据源
      sourceData: {}, // 页面跳转传来的数据
      mpdsList: {
        mpds0: '交通/运输事故',
        mpds1: '高处坠落',
        mpds2: '暴力袭击/侵犯',
        mpds3: '动物咬伤/攻击',
        mpds4: '烧伤(烫伤)/爆炸伤',
        mpds5: '锐器刺伤/枪伤/贯穿伤',
        mpds6: '触电/雷击伤',
        mpds7: '冬季运动损伤',
        mpds8: '机械损伤',
        mpds9: '创伤(其他创伤)'
      },
      diagnoseContentList: {
        0: '非急',
        1: '亚急',
        2: '急症',
        3: '危重',
        4: '濒危',
        5: '已死亡'
      },
      curindex: 0
    }
  },
  computed: {},
  created() {
    this.isTruma = false
    this.isCuZhongMap = false
    console.log(this.$store.getters, 'webcfg')
    if (this.$store.getters.webcfg) {
      const webcfg = this.$store.getters.webcfg.split('|')
      for (let ii = 0; ii < webcfg.length; ii++) {
        if (webcfg[ii] == 'trauma') {
          this.isTruma = true
        }
        if (webcfg[ii] == 'czmap') {
          this.isCuZhongMap = true
        }
      }
    }
    this.JumpJudgment()
    this.userRoleJudgment()
  },
  mounted() {
    this.VUE_APP_BASE_API_DATA_BRANCH = process.env.VUE_APP_BASE_API_DATA_BRANCH
    // console.log("this.queryParam",this.queryParam)
    if (this.$route.params.rowStr) {
      this.$emit('homePageToFather', JSON.parse(this.$route.params.rowStr), false)
    } else {
      this.init()
    }
    this.getDept()
    this.tableFilterGet()
  },
  methods: {
    initScroll() {
      const _this = this
      console.log(document.getElementById('map-box'), 'map-box')
      const mapBox = document.getElementById('map-box')
      if (mapBox) {
        console.log('滚动了111----')
        // 监听页面滚动事件
        mapBox.addEventListener('scroll', function() {
          console.log('滚动了222----')
          var removeClass = function(obj, cls) {
            if (obj.className.includes(cls)) {
              obj.className = 'left-line'
            }
          }
          var addClass = function(obj, cls) {
            if (!obj.className.includes(cls)) {
              obj.className = cls + ' left-line'
            }
          }

          const pos = document.querySelector('#box-right').scrollTop
          console.log(pos, 'pos')
          // 获取全部导航dom与元素dom
          var navList = document.querySelector('#box-left').querySelectorAll('.left-line')
          var items = document.querySelector('#box-right').querySelectorAll('.right-content')

          // 滚动后遍历元素，如果页面滚动位置大于元素的位置，赋值给变量
          var currentId = ''
          for (var i = 0; i < items.length; i++) {
            var _item = items[i]
            var _itemTop = _item.offsetTop
            if (pos >= _itemTop - 79) {
              currentId = _item.id
            } else {
              break
            }
          }
          console.log(currentId, 'currentId')
          // 如果已赋值了变量，进行匹配，如果匹配则添加class其他删除
          if (currentId) {
            for (var j = 0; j < navList.length; j++) {
              var _navItem = navList[j]
              var _navId = _navItem.getAttribute('data-id')
              if (_navId != currentId) {
                removeClass(_navItem, 'cls')
              } else {
                addClass(_navItem, 'cls')
              }
            }
          }
        }, true)
      }
    },
    skipView(skipId) {
      document.getElementById(skipId).scrollIntoView()
    },
    submitMap() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      uploadSdcStrokeMapData({
        dispatchId: this.mapId
      }).then(res => {
        if (res.code == 0) {
          this.$message.success('上传成功')
          this.mapVisible = false
          this.init()
        }
        loading.close()
      })
    },
    // 点击同步至卒中地图按钮
    syncMap(row) {
      const loading = this.$loading({
        lock: true,
        text: '正在读取数据中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      this.mapId = ''
      this.isUploadStrokeMap = ''
      this.isVerifyStrokeMap = ''
      this.mapId = row.dispatchId
      this.isUploadStrokeMap = row.isUploadStrokeMap
      this.isVerifyStrokeMap = row.isVerifyStrokeMap
      this.mapHZData = []
      this.mapPREData = []
      this.mapTZData = []
      this.mapMEDData = []
      this.mapLABData = []
      this.mapIMGData = []
      this.mapTRIData = []
      this.mapREPData = []
      this.mapOUTData = []
      this.mapTIMEData = []
      this.mapGRADEData = []
      this.mapATTData = []
      getStrokeMapData({
        dispatchId: row.dispatchId
      }).then(res => {
        if (res.code == 0) {
          if (res.data.showData.HuanZhe) {
            this.mapHZData = res.data.showData.HuanZhe.split('\n')
          }
          if (res.data.showData.YuanQianChuZhi) {
            this.mapPREData = res.data.showData.YuanQianChuZhi.split('\n')
          }
          if (res.data.showData.TiZheng) {
            this.mapTZData = res.data.showData.TiZheng.split('\n')
          }
          if (res.data.showData.BingLi) {
            this.mapMEDData = res.data.showData.BingLi.split('\n')
          }
          if (res.data.showData.TB_JZpatient_Lab) {
            this.mapLABData = res.data.showData.TB_JZpatient_Lab.split('\n')
          }
          if (res.data.showData.TB_JZpatient_Image) {
            this.mapIMGData = res.data.showData.TB_JZpatient_Image.split('\n')
          }
          if (res.data.showData.YiXianYiShengZaXiang) {
            this.mapTRIData = res.data.showData.YiXianYiShengZaXiang.split('\n')
          }
          if (res.data.showData.ZaiGuanZhuZhiLiao) {
            this.mapREPData = res.data.showData.ZaiGuanZhuZhiLiao.split('\n')
          }
          if (res.data.showData.ZhuanGui) {
            this.mapOUTData = res.data.showData.ZhuanGui.split('\n')
          }
          if (res.data.showData.JieDian) {
            this.mapTIMEData = res.data.showData.JieDian.split('\n')
          }
          if (res.data.showData.PingFen) {
            this.mapGRADEData = res.data.showData.PingFen.split('\n')
          }
          if (res.data.showData.FuJian) {
            this.mapATTData = res.data.showData.FuJian.split('\n')
          }
          this.mapVisible = true
          this.$nextTick(() => {
            this.initScroll()
          })
          loading.close()
        } else {
          this.$message({
            type: 'error',
            message: res.message
          })
          loading.close()
        }
      })
    },
    getDept() {
      this.deptList = []
    },
    init() {
      this.queryList()
      this.queryCounts()
      this.hospitalIdDept()
    },
    // 表格列自定义排序
    sortTableHeadle(a, b, propName) {
      return new Date(a[propName]) - new Date(b[propName])
    },
    // 表头筛选比对过滤
    filterTableHeader(propName) {
      if (this.tagSwitchover == '胸痛') {
        return this.tableHeadersFilter.includes(propName)
      } else if (this.tagSwitchover == '卒中') {
        // console.log(this.tableHeadersFilter.includes(propName))
        return this.tableHeadersStrokeFilter.includes(propName)
      } else if (this.tagSwitchover == '创伤') {
        return this.tableHeadersTraumaFilter.includes(propName)
      }
    },
    // 表格导出
    exportExcel() {
      import('@/vendor/Export2Excel')
        .then((excel) => {
          // console.log(this.tagSwitchover)
          let filterVal
          if (this.tagSwitchover === '胸痛') {
            filterVal = this.tableHeadersFilter
          } else if (this.tagSwitchover === '卒中') {
            filterVal = this.tableHeadersStrokeFilter
          } else if (this.tagSwitchover === '创伤') {
            filterVal = this.tableHeadersTraumaFilter
          }

          // console.log("1",this.excelHeaders)
          // console.log("2",this.tableHeadersFilter)
          // console.log("3",this.tableData)
          const tHeader = []
          for (const table_header in this.excelHeaders) {
            if (filterVal.indexOf(table_header) !== -1) {
              tHeader.push(this.excelHeaders[table_header])
            }
          }
          // console.log(tHeader, 'tHeader')
          const list = this.tableData
          if (list && list.length > 0) {
            list.forEach(el => {
              console.log(el)
              if (el.isUpload == 0) {
                el.isUpload = '未上报'
              } else {
                el.isUpload = '已上报'
              }
              if (el.cpcstat == 0) {
                el.cpcstat = '未上报'
              } else {
                el.cpcstat = '已上报'
              }
              if (el.yzystat == 0) {
                el.yzystat = '初始填写'
              } else if(el.yzystat == 1){
                el.yzystat = '退回重填'
              }else if(el.yzystat == 2){
                el.yzystat = '提交审核中'
              }else if(el.yzystat == 3){
                el.yzystat = '初审通过'
              }else if(el.yzystat == 4){
                el.yzystat = '上报重填'
              }else if(el.yzystat == 5){
                el.yzystat = '上报列队中'
              }else if(el.yzystat == 6){
                el.yzystat = '已上报'
              }
            })
          }
       
          const data = this.formatJson(filterVal, list)
          // console.log(filterVal, list,tHeader,data)
          // return
          excel.export_json_to_excel({
            header: tHeader, // 表头 必填
            data, // 具体数据 必填
            filename: '患者列表', // 非必填
            autoWidth: true, // 非必填
            bookType: 'xlsx' // 非必填
          })
        })
        .catch((err) => {
          console.log('导出失败', err)
        })
    },
    // 格式转换,不需要改动
    formatJson(filterVal, jsonData) {
      return jsonData.map((v) =>
        filterVal.map((j) => {
          if (j === 'isUpload') {
            return !v[j] ? '未上报' : '已上报'
          } else {
            return v[j]
          }
        })
      )
    },
    /*
     *根据用户角色隐藏胸痛||卒中
     */
    userRoleJudgment() {
      const sysRole =
        typeof this.$store.getters.sysRole !== 'string'
          ? this.$store.getters.sysRole
          : JSON.parse(this.$store.getters.sysRole)
      if (!sysRole.includes('超级管理员')) {
        if (sysRole.includes('心内科')) {
          this.tagSwitchover = '胸痛'
          this.toggleShow = false
        } else if (sysRole.includes('神内科')) {
          this.tagSwitchover = '卒中'
          this.toggleShow = false
        }
      }
    },
    hospitalIdDept() {
      hospitalIdDept({
        hospitalId: this.$store.getters.hospitalId,
        pageNum: 1,
        pageSize: 1,
        greenType: this.tagSwitchover,
        token: getToken()
      }).then(res => {
        if (res.code == 0) {
          if (res.data) {
            if (res.data.list && res.data.list.length > 0) {
              this.deptList = res.data.list
              console.log(this.deptList, '建档科室')
            }
          }
        }
      })
    },

    /*
      *跳转判断
      * 接收跳转值并进入急救信息页面
      *
          let data={
             name: 'patientsList',
             sourcePage : '来源页面名',
             diseaseType: '胸痛',   //二选一
             greenType: '胸痛',   //二选一
             dispatchId: "12345"
           }
           this.$router.push({
             name: 'patientsList',
             params: data
           })
      *
    */
    JumpJudgment() {
      this.sourceData = this.$route.params
      // console.log('接收跳转数据', this.sourceData)
      if (this.sourceData.sourcePage) {
        this.tagSwitchover =
          this.sourceData.diseaseType || this.sourceData.greenType || '胸痛'
        this.queryParam.dispatchId = this.sourceData.id || ''
      }
      if (this.sourceData.sourcePage === 'Socket') {
        this.tabCheck = 'consultation'
        const tab = {
          name: 'consultation'
        }
        this.handleClick(tab)
      }
    },
    // 关注/取消关注
    attentionStatus(row) {
      const data = {
        userId: this.$store.getters.userId,
        status: !parseInt(row.attStatus) ? '1' : '0',
        dipatchlist: row.dispatchId
      }
      updateAttention(data).then((res) => {
        if (res.code !== 9999) {
          this.$message.success('修改成功')
        } else {
          this.$message.error('修改失败')
        }
        this.queryList()
      })
    },
    /*
     *页面上方快捷查询(今)
     * isUpload : 上报状态 (1已上报,  2未上报)
     * diagnose: 诊断结果
     */
    todayQuery(isUpload, diagnose) {

      this.clearPagination()
      this.tabCheck = 'all'
      this.isOut = this.isOutList[this.tabCheck]
      this.consultationCheck = false
      this.queryClear()
      const date = new Date()
      const year = date.getFullYear() // 获取完整的年份(4位,1970)
      const month = date.getMonth() + 1 // 获取月份(0-11,0代表1月,用的时候记得加上1)
      const day = date.getDate() // 获取日(1-31)
      const startTime = `${year}-${month}-${day} 00:00:00`
      const endTime = `${year}-${month}-${day} 23:59:59`
      this.queryParam.timeRange = [startTime, endTime]
      if (isUpload !== null) {
        this.activeNames = true
        this.queryParam.isUpload = isUpload
      }
      if (diagnose !== null) {
        this.activeNames = true
        this.queryParam.diagnose = diagnose
      }
      this.queryList()
    },
    /*
     *页面上方快捷查询(总)
     * isUpload : 上报状态 (1已上报,  2未上报)
     * diagnose: 诊断结果
     */
    allQuery(isUpload, diagnose) {
      this.clearPagination()
      this.tabCheck = 'all'
      this.isOut = this.isOutList[this.tabCheck]
      this.consultationCheck = false
      this.queryClear()
      if (isUpload !== null) {
        this.activeNames = true
        this.queryParam.isUpload = isUpload
      }
      if (diagnose !== null) {
        this.activeNames = true
        this.queryParam.diagnose = diagnose
      }
      this.queryList()
    },
    clearPagination() {
      this.page = 1
      this.limit = 10
      this.count = 0
    },
    tagChange() {
      this.queryClear()
      this.clearPagination()
      this.queryList()
      this.activeNames = false
      // this.queryCounts()
    },
    queryCounts() {
      const data = {
        userId: this.userId
      }
      if (this.tagSwitchover === '卒中') {
        dispatcheCISSummaryCountsToday(data).then((res) => {
          this.summaryCount = res
        })
        dispatcheCISSummaryCounts(data).then((res) => {
          this.summaryCountAll = res
        })
      } else if (this.tagSwitchover === '胸痛') {
        // 胸痛
        dispatcheACSSummaryCountsToday(data).then((res) => {
          this.summaryCount = res
        })
        dispatcheACSSummaryCounts(data).then((res) => {
          this.summaryCountAll = res
        })
      } else if (this.tagSwitchover === '创伤') {
        dispatcheTraumaSummaryCountsToday(data).then(res => {
          this.summaryCount = res
        })
        dispatcheTraumaSummaryCounts(data).then(res => {
          this.summaryCountAll = res
        })
      }
    },

    checkRecords(data) {
      console.log('data', data)
      console.log('dispatchId', data.dispatchId)
      // 将点击行dispatchId,dispatchId传给父组件patients-list， consultationCheck标识着是否由会诊页面进入
      this.$emit('homePageToFather', data, this.consultationCheck)
    },
    deletRecords(row) {
      this.$confirm('是否删除改患者数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deletePatient({
          apiToken: this.apiToken,
          medicalId: row.medicalId,
          dispatchId: row.dispatchId
        }).then(res => {
          if (res.code == 0) {
            this.$message({
              type: 'success',
              message: '删除成功!'
            })
            this.queryList()
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    handleSizeChange(val) {
      this.queryList()
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      this.queryList()
      console.log(`当前页: ${val}`)
    },
    handleClick(tab, event) {
      this.clearPagination()
      if (tab.name !== 'consultation') {
        // 如果不是会诊中
        this.isOut = this.isOutList[tab.name]
        this.consultationCheck = false
        this.queryList()
      } else {
        this.consultationCheck = true
        this.queryList()
      }
      console.log(tab.name, event)
    },
    queryClear() {
      this.$refs['queryForm'].resetFields()
    },
    queryList(isUpload, detailType) {
      this.isOut = this.isOutList[this.tabCheck]
      console.log("this.tabCheck",this.tabCheck,this.isOutList[this.tabCheck])

      const loading = this.$loading({
        lock: true, // lock的修改符--默认是false
        text: 'Loading', // 显示在加载图标下方的加载文案
        spinner: 'el-icon-loading', // 自定义加载图标类名
        // background: 'rgba(0, 0, 0, 0.7)', // 遮罩层颜色
        target: document.querySelector('#rootNode') // loadin覆盖的dom元素节点
      })
      this.tableData = []
      console.log('开始')
      console.log("this.queryParam.yzystat",this.queryParam.yzystat)
      const params = {
        isOut: this.isOut,
        limit: this.limit,
        page: this.page,
        userId: this.userId,
        isUpload: this.queryParam.isUpload, // 上报状态
        cpcstat: this.queryParam.cpcstat, // 建档上报
        yzystat: this.queryParam.yzystat, // 最终上报
        order: this.queryParam.order, // 时间排序
        patientName: this.queryParam.patientName, // 姓名
        diseaseType: this.tagSwitchover, // '胸痛' 或 '卒中' 或 '创伤'
        apiToken: this.apiToken,
        dispatchId: this.queryParam.dispatchId, // 患者编号
        datestart: this.queryParam.timeRange
          ? this.queryParam.timeRange[0]
          : '', // 开始时间
        dateend: this.queryParam.timeRange ? this.queryParam.timeRange[1] : '', // 结束时间
        comeway: this.queryParam.comeway, // 来院方式
        diagnose: 'mpds' + this.queryParam.mpds,
        sex: this.queryParam.sex, // 性别
        agestart: this.queryParam.agestart, // 年龄段(小)
        ageend: this.queryParam.ageend, // 年龄段(大)
        dept: this.queryParam.dept, // 科室
        cas: this.queryParam.cas, // 病情判断
        filldoc: this.queryParam.filldoc // 数据填报员

        // treatment: this.queryParam.treatment, // 治疗措施
      }
      if (this.tagSwitchover === '胸痛') {
        params.diagnose = this.queryParam.diagnose
      } else if (this.tagSwitchover === '卒中') {
        params.treatment = this.queryParam.treatment
        if (this.queryParam.diagnose !== '') {
          params[this.queryParam.diagnose] = 1
        }
      } else if (this.tagSwitchover === '创伤') {
        if (!this.queryParam.mpds) {
          params.diagnose = this.queryParam.diagnose
        }
      }
      // console.log(this.consultationCheck, 'this.consultationCheck')
      this.hospitalIdDept()
      if (this.consultationCheck) {
        // 是 会诊tab页
        queryConsultationListGet(params).then((res) => {
          if (res.data && res.data.length > 0) {
            res.data.forEach(el => {
              let treatmentMode = ''
              el.performanceName = el.doctorName
              if (el.jieru) {
                treatmentMode += '介入，'
              }
              if (el.rongshuan) {
                treatmentMode += '溶栓，'
              }
              if (el.naocx) {
                treatmentMode += '脑出血手术，'
              }
              if (el.dml) {
                treatmentMode += '动脉瘤，'
              }
              if (el.ceacas) {
                treatmentMode += 'CEA/CAS手术，'
              }
              // console.log(treatmentMode, 'treatmentMode')
              el.treatment = treatmentMode
            })
            this.tableData = res.data
            // console.log("this.tableData",this.tableData)
            if (res.data.length === 0) {
              this.$message.warning('无符合条件的患者信息')
            } else {
              if (res.data) {
                this.count = parseInt(res.count) || 0
                // 如果是其他页面跳转过来,即查看患者详细信息
                if (this.sourceData.sourcePage) {
                  this.sourceData = {}
                  // this.$route.params = {}
                  this.checkRecords(res.data[0])
                }
              }
            }
            // 成功回调函数停止加载
            loading.close()
          } else {
            this.$message.warning('无符合条件的患者信息')
            loading.close()
          }
        })
      } else {
        console.log(params, 'params')
        queryListGet(params).then((res) => {
          res.data.forEach((el, index, arr) => {
            // 将字断颅内动脉瘤与APP端统一
            if (el.diagnoseContent && el.diagnoseContent.indexOf('未破裂颅内动脉瘤') !== -1) {
              res.data[index].diagnoseContent = el.diagnoseContent.replace('未破裂颅内动脉瘤', '颅内动脉瘤')
            }
            let treatmentMode = ''
            if (el.mpds) {
              // console.log(JSON.parse(el.mpds)[0])
              el.mpds = this.mpdsList[JSON.parse(el.mpds)[0]]
            }
            if (this.tagSwitchover == '创伤') {
              if (el.diagnoseContent) {
                el.diagnoseContent = this.diagnoseContentList[el.diagnoseContent]
              }
            }
            el.performanceName = el.doctorName
            if (el.jieru) {
              treatmentMode += '介入,'
            }
            if (el.rongshuan) {
              treatmentMode += '溶栓,'
            }
            if (el.naocx) {
              treatmentMode += '脑出血手术,'
            }
            if (el.dml) {
              treatmentMode += '动脉瘤,'
            }
            if (el.ceacas) {
              treatmentMode += 'CEA/CAS手术,'
            }
            // if(this.tagSwitchover == '卒中'){
            //   el.comeway = "在院卒中"
            // }
            console.log(treatmentMode, 'treatmentMode')
            el.treatment = treatmentMode
          })
          // console.log(res.data, 'res.data')
          this.tableData = res.data
          // if (this.tagSwitchover === '胸痛') {
          //   this.tableData = [{ diseaseType: '胸痛' }]
          // } else if (this.tagSwitchover === '卒中') {
          //   this.tableData = [{ diseaseType: '卒中' }]
          // } else if (this.tagSwitchover === '创伤') {
          //   this.tableData = [{ diseaseType: '创伤' }]
          // }
          // res.data || []
          if (!!res.data && res.data.length !== 0) {
            this.count = parseInt(res.count)

            // 如果是其他页面跳转过来,即查看患者详细信息
            if (this.sourceData.sourcePage) {
              this.sourceData = {}
              // this.$route.params = {}
              this.checkRecords(res.data[0])
              // console.log('meila--------')
            }
          } else {
            this.$message.warning('无符合条件的患者信息')
          }

          // 成功回调函数停止加载
          loading.close()
        })
      }
      this.queryCounts()
    },
    // 新增卒中
    strokeInfoAdd() {
      // 调用新增接口新增患者
      newDispatch({
        apiToken: this.$store.getters.apiToken,
        greenType: this.tagSwitchover
      }).then((res) => {
        const obj = res.data
        // dispatchId: obj.dispatchId,
        if (res.code === 0) {
          this.$message.success('新增成功')
          const params = {
            limit: 1,
            page: 1,
            userId: this.userId,
            diseaseType: this.tagSwitchover, // '胸痛' 或 '卒中' 或 '创伤'
            apiToken: this.apiToken,
            dispatchId: obj.dispatchId // 患者编号
          }
          this.queryList()
          // 获取新增患者信息并进入患者详情
          queryListGet(params).then((res) => {
            if (res.data && res.data.length > 0) {
              res.data[0].state = 'creating'
              const newPatient = true
              this.$emit('homePageToFather', res.data[0], false, newPatient)
            }
            this.queryList()
          })
        } else {
          this.$message.error('新增失败')
        }
      })
      // this.$router.push({ name: 'InfoStrokeNew' })
    },
    tableFilter(e, key) {
      localStorage.setItem(key+"new", JSON.stringify(e))
    },
    tableFilterGet() {
      if (localStorage.hasOwnProperty('胸痛'+"new")) {
        this.tableHeadersFilter = JSON.parse(localStorage.getItem('胸痛'+"new"))
      }
      if (localStorage.hasOwnProperty('卒中'+"new")) {
        this.tableHeadersStrokeFilter = JSON.parse(localStorage.getItem('卒中'+"new"))
      }
      if (localStorage.hasOwnProperty('创伤'+"new")) {
        this.tableHeadersTraumaFilter = JSON.parse(localStorage.getItem('创伤'+"new"))
      }
    },
    getRowKey(row) {
      return new Date().getTime().toString()
    }
  }
}
</script>
<style scoped>
.cls{
  color: #fff;
  background-color: #13C2C2 !important;
}
.map-box{
  width: 100%;
  display: flex;
}
.box-left{
  width: 120px;
}

.box-right{
  width: calc(100% - 130px);
  margin-left: 10px;
  overflow-y: auto;
  height: 600px;
}
.right-content{
  margin-bottom: 10px;
}
.right-title{
  line-height: 20px;
  font-size: 20px;
  font-weight: 600;
}
.box-right>>> .el-form-item{
  margin-bottom: 0;
}
.left-line{
  font-size: 14px;
  line-height: 20px;
  background-color: #ccc;
  margin-bottom: 5px;
  border-radius: 4px;
  padding-left: 5px;
  cursor: pointer;
}
#tagSwitchoverBtn {
  padding-bottom: 20px;
}

#tagSwitchoverBtn>>>.el-radio-button__inner {
  height: 45px;
  line-height: 25px;
  width: 90px;
}

.floatR {
  float: right;
}

.floatL {
  float: left;
}

.marginR20 {
  margin-right: 20px;
}

#rootNode {
  background-color: #f2f2f2;
}

#overview {
  border-bottom: 10px solid #f2f2f2;
}

/*
#patientList {
   width: 80%;
} */

#patientList .patientData {
  width: 300px;
  height: 70px;
  margin-right: 20px;
  border-radius: 3px;
  line-height: 70px;
  display: inline-block;
}

#patientList .patientData .el-card__body {
  padding: 0px;
}

#patientList .patientData .patientIcon {
  border-radius: 5px;
  display: inline;
  float: left;
  font-size: 28px;
  width: 40px;
  height: 40px;
  margin: 15px 0px 0px 20px;
  padding: 0px 6px;
  line-height: 40px;
  color: white;
}

.qbsbsl {
  background-color: #457be9;
}

.ysbsl {
  background-color: #4ca1fe;
}

.wsbsl {
  background-color: #f85d61;
}

.title_gailan_left_span {
  float: left;
  color: #454c5f;
  font-size: 16px;
  margin-left: 10px;
}

.title_gailan_right_span {
  float: right;
  color: #454c5f;
  font-size: 28px;
  margin-right: 10px;
}

.content_num {
  cursor: pointer;
  cursor: hand;
  text-decoration: underline;
}

.title_gailan_right_inner_span {
  position: relative;
  font-size: 16px;
  top: -3px;
  /* line-height: 35px; */
}

.summary_div {
  margin-top: 20px;
  padding-bottom: 20px;
  /* border-bottom: 10px solid #f2f2f2; */
  width: auto;
}

.seven_part {
  display: inline-block;
  width: 210px;
  border-radius: 4em;
  line-height: 40px;
  /* position: relative; */
  margin-left: 0.5%;
}

.seven_part_left_span {
  float: left;
  position: relative;
  left: 10px;
  color: #fff;
  font-size: 14px;
}

.seven_part_right_span {
  float: right;
  position: relative;
  right: 10px;
  color: #fff;
  font-size: 20px;
}

.seven_part_right_inner_span {
  position: relative;
  font-size: 14px;
  top: -3px;
}

/* @media screen and (max-width: 1366px) and (min-width: 0px) { */

.border-blue {
  display: inline-block;
  width: 3px;
  background-color: #4ca3ff;
}

.seven_part {
  display: inline-block;
  width: 13.28%;
  border-radius: 4em;
  line-height: 30px;
  position: relative;
  margin-left: 0.7%;
}

.seven_part_left_span {
  float: left;
  position: relative;
  left: 5px;
  color: #fff;
  font-size: 12px;
}

.seven_part_right_span {
  float: right;
  position: relative;
  right: 5px;
  color: #fff;
  font-size: 20px;
}

.seven_part_right_inner_span {
  position: relative;
  font-size: 12px;
  top: 0px;
}

.summary_div {
  margin-top: 10px;
  padding-bottom: 10px;
  /* border-bottom: 10px solid #f2f2f2; */
  width: auto;
}

.title {
  margin: 10px 20px;
}

.tab_div {
  margin-left: 20px;
  margin-top: 10px;
}

.tab_content_div {
  margin-top: 10px;
}

.title_gailan {
  width: 20%;
  height: 40px;
  margin-right: 4%;
  border: 1px solid #454c5f;
  border-radius: 5px;
  line-height: 40px;
  display: inline-block;
}

.title_gailan_left_span {
  float: left;
  position: relative;
  left: 5px;
  color: #454c5f;
  font-size: 12px;
}

.title_gailan_right_span {
  float: right;
  position: relative;
  right: 5px;
  color: #454c5f;
  font-size: 12px;
}

.title_gailan_right_inner_span {
  position: relative;
  font-size: 12px;
  top: 0px;
}

.qbsbsl {
  border-radius: 5px;
  display: inline;
  float: left;
  font-size: 20px;
  width: 30px;
  height: 30px;
  margin: 5px 0px 0px 10px;
  padding: 0px 5px;
  line-height: 30px;
  background-color: #457be9;
  color: white;
}

.ysbsl {
  border-radius: 5px;
  display: inline;
  float: left;
  font-size: 20px;
  width: 30px;
  height: 30px;
  margin: 5px 0px 0px 10px;
  padding: 0px 5px;
  line-height: 30px;
  background-color: #4ca1fe;
  color: white;
}

.wsbsl {
  border-radius: 5px;
  display: inline;
  float: left;
  font-size: 20px;
  width: 30px;
  height: 30px;
  margin: 5px 0px 0px 10px;
  padding: 0px 5px;
  line-height: 30px;
  background-color: #f85d61;
  color: white;
}

/* } */
</style>
<style>
path {
  fill: inherit !important;
}

#queryTable {
  position: relative;
}

#queryTable .el-tabs__header {
  margin-bottom: 0;
}

#queryTable .tableBtnGroup {
  display: inline-block;
  position: absolute;
  right: 10px;
  top: 6px;
  color: #000000;
}

#queryTable .tableBtnGroup button {
  margin-right: 10px;
}

/* 顶部统计样式 */
#todayTotal,
#allTotal {
  color: #ffffff;
  border-radius: 10px;
  padding: 15px 20px 15px;
}

#todayTotal {
  background-color: #5ca4ff;
}

#allTotal {
  background-color: #68cda5;
}

.totalTop {
  position: relative;
  /* padding: 0 2px 3px; */
  border-bottom: 3px solid #ffffff;
}

.totalbtm {
  font-weight: 100;
}

.iconTotal {
  position: absolute;
  right: 5px;
  top: 0;
  font-size: 37px;
}

.fontLv01 {
  font-size: 25px;
}

.fontLv02 {
  font-size: 18px;
}

.fontLv12 {
  font-size: 12px;
}

.totalLine {
  width: 49%;
  height: 100px;
  margin: 15px 0;
  border-right: 1px solid #eff6ff;
}

.quantityTotal {
  display: inline-block;
  width: 15%;
}

/* 顶部统计样式-End */

.advancedQuery {
  padding: 20px 0 0 10px;
  background-color: #eee;
  margin-bottom: 10px;
  border-radius: 5px;
}

.ageWidth {
  width: 20%;
}

.ageWidth>.el-form-item__content {
  width: calc(100% - 60px);
}

/* 表头错位问题-Start */
body .el-table th.gutter {
  display: table-cell !important;
}

body .el-table colgroup.gutter {
  display: table-cell !important;
}

.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}

/* 表头错位问题-End */
</style>
